#include<stdio.h>
#include<string.h>
char a[600000], b[600000];
int main() {
	int a1, b1;
	gets(a);
	gets(b);
	a1= strlen(a);
	b1 = strlen(b);
	int c = 0, j, k, flog=0;
	for (int i = 0; i <=a1-b1; i++) {
		if (a[i]==b[0]) {
			j = i + 1, k = 1, c = 1;
			while (a[j] ==b[k]&&j<a1&&k<b1) {
				c++;
				k++; j++;
			}
			if (c == b1) {
				flog = 1;
				for (c = 0; c < i; c++) {
					printf("%c", a[c]);
				}
				for (c = j; c < a1; c++) {
					printf("%c", a[c]);
				}
				break;
			}
		}
	}
	if (!flog)
		printf("NO");
	if (flog&&a1 == b1) {
		printf("NULL");
	}
	return 0;
}